﻿@model MatTroi.vn.Models.HomeViewModel

@{
    ViewBag.Title = "mattroi.vn-Danh bạ internet Việt Nam";
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
    <script src="@Url.Content("~/Scripts/jquery-1.6.3.min.js")" type="text/javascript"></script>
}
<div style="height:1900px;width:1350px;">
    <div class="webnoibat-head">
        <div class="webnoibat-head-title"><a>Website Nổi Bật</a></div>
        <hr />
    </div>
    <div class="webnoibat-content">
        @foreach (var item in Model.getWebNoiBat())
        {
            <div class="webnoibat-item">
                <div class="webnoibat-icon">
                    <a href="@item.URL" target="_blank">
                        <img src="~/Image/Website/@item.HinhAnh" />
                    </a>
                </div>
                @if (item.TenWebsite.ToString().Length >8)
                {
                    <a href ="@item.URL">@item.TenWebsite.Substring(0,8)...</a>
                }
                else
                {
                    <a href="@item.URL">@item.TenWebsite</a>
                }
            </div>
        }
    </div>

    <!-- Danh muc nho-->
    @foreach (var danhMucCha in Model.GetDanhMuc())
    {
        <!--Danh muc lon-->

        if (Model.KiemTraGioiThieu(danhMucCha.ID_DanhMuc) != false)
        {
            <div class="danhmuclon-tag-ngang">
                <div class="danhmuclon-tag-ngang-head">
                    <div class="webnoibat-head-title"><a href="" target="_blank">@Html.ActionLink(danhMucCha.TenDanhMuc, "Category", new { @id = danhMucCha.ID_DanhMuc }, null)</a></div>
                    <hr />
                </div>
                <div class="danhmuclon-tag-ngang-content">
                    <div class="danhmuclon-tag-ngang-content-top">
                        <!--Show slide on the game tag-->
                        @foreach (var web in Model.getChiTietTheLoai(danhMucCha.ID_DanhMuc))
                        {
                            <div class="danhmuclon-tag-ngang-content-top-item">
                                <div class="icon"></div>
                                <a href="@web.URL" target="_blank">
                                    <img src="~/Image/Website/@web.HinhAnh" />
                                </a>
                                <div class="content-overplay">
                                    @if (web.TenWebsite.ToString().Length > 11)
                                    {
                                        <div class="titleGame">@web.TenWebsite.Substring(0, 11)...</div>
                                    }
                                    else
                                    {
                                        <div class="titleGame">@web.TenWebsite</div>

                                    }
                                </div>
                            </div>
                        }
                    </div>
                    @foreach (var item in Model.GetWebDanhMucLon(danhMucCha.ID_DanhMuc))
                    {

                        <div class="icon-item-ngang">
                            <div class="icon">
                                <img src="~/Image/Website/@item.HinhAnh" />
                            </div>

                            <div class="title">
                                @if (item.TenWebsite.ToString().Length > 12)
                                {
                                    <a href="@item.URL" target="_blank">@item.TenWebsite.Substring(0, 12)...</a>
                                }
                                else
                                {
                                    <a href="@item.URL" target="_blank">@item.TenWebsite</a>

                                }
                            </div>
                        </div>
                    }
                    <div class="danhmuclon-tag-ngang-content-bottom"></div>
                </div>
            </div>
        }
        else
        {
            <div class="danhmuccon-tag">
                <div class="webdanhmucnho-head">
                    <div class="webnoibat-head-title">
                        <div style="float:left; width:312px;height:45px;"><img style="float:left;margin-top:8px;"src="~/Image/DanhMuc/@danhMucCha.HinhAnh"/> <a href="@Url.Action("Category", "TrangChu", new { @id = danhMucCha.ID_DanhMuc })" target="_blank">@danhMucCha.TenDanhMuc</a></div>
                        <div style="float:right; width:313px;height:45px;"> <a style="float:right; margin-right:30px; color:#0094ff!important; font-style:italic;font-size:13px!important" href="@Url.Action("Category", "TrangChu", new { @id = danhMucCha.ID_DanhMuc })" target="_blank">Xem thêm>></a></div>
                </div>
                <hr /> 
                </div>
                <!--Noi dung ben trong no-->
                <div class="webdanhmucnho-content">

                    @foreach(var w in Model.GetWebDanhMuc(danhMucCha.ID_DanhMuc))
                        {
                    <div class="icon-item">
                        <div class="icon">
                            <img src="~/Image/Website/@w.HinhAnh" />
                        </div>
                        <div class="title">
                            @if (w.TenWebsite.ToString().Length > 12)
                            {
                                <a href="@w.URL" target="_blank">@w.TenWebsite.Substring(0, 12)...</a>
                            }
                            else
                            {
                                <a href="@w.URL" target="_blank">@w.TenWebsite</a>

                            }
                        </div>
                    </div>
                                            }
                </div>
                <!--End noi dung ben trong no-->
            </div>
        }
        <!--End danh muc lon-->

    }
</div>
    <!--End danh muc phim-->
    <!-- Danh muc phu-->
    <div class="TheLoai1">
            <ul class="tab_nav1 clearfix"> <li><a href="#tab_1">Xem thêm...</a></li></ul>
            <div class="clear"></div>
                <ul id="tab_1" class="tab_content1">
                    @foreach (var dma in Model.GetDanhMucAn())
                    {
                        <li class="danhmuccon-tag">
                            <div class="webdanhmucnho-head">
                                <div class="webnoibat-head-title">
                                    <div style="float:left; width:312px;height:45px;"> <a href="@Url.Action("Category", "TrangChu", new { @id = dma.ID_DanhMuc })" target="_blank">@dma.TenDanhMuc</a></div>
                                    <div style="float:right; width:313px;height:45px;"> <a style="float:right; margin-right:30px; color:#0094ff!important; font-style:italic;font-size:13px!important" href="@Url.Action("Category", "TrangChu", new { @id = dma.ID_DanhMuc })" target="_blank">Xem thêm>></a></div>
                                </div>
                                <hr /> 
                            </div>
                            <!--Noi dung ben trong no-->
                            <div class="webdanhmucnho-content">

                                @foreach (var w in Model.GetWebDanhMucAn(dma.ID_DanhMuc))
                                {
                                    <div class="icon-item">
                                        <div class="icon">
                                            <img src="~/Image/Website/@w.HinhAnh" />
                                        </div>
                                        <div class="title">
                                            @if (w.TenWebsite.ToString().Length > 12)
                                            {
                                                <a href="@w.URL" target="_blank">@w.TenWebsite.Substring(0, 12)...</a>
                                            }
                                            else
                                            {
                                                <a href="@w.URL" target="_blank">@w.TenWebsite</a>

                                            }
                                        </div>
                                    </div>
                                }
                            </div>
                            <!--End noi dung ben trong no-->
                        </li>
                    }
                </ul>
</div>

<script src="@Url.Content("~/Scripts/jquery-1.7.1.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        tab();
    });
    function tab() {
        $t = 0;
        $('.tab_content1').hide();
              $('.tab_nav1 li a').click(function () {
              $('.tab_content1').show();
        });
    }
  
</script>